package chap13;

import java.io.PrintStream;
import java.util.Formatter;

public class Turtle {
	private String name;
	private Formatter f;
	public Turtle(String name, Formatter f) {
		super();
		this.name = name;
		this.f = f;
	}
	public void move(int x,int y){
		f.format("%s move to (%d,%d)\n", name,x,y);
	}
	public static void main(String[] args) {
		PrintStream pw=System.err;
		Turtle t1=new Turtle("tom", new Formatter(System.err));
		Turtle t2=new Turtle("jerry", new Formatter(pw));
		t1.move(0, 0);
		t2.move(1, 1);
	}
	

}
